<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.2"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>轮回之牢: D:/Code/cProgram/CPP/Qt/TeamCurriculumDesign/Item/BaseItem.h 源文件</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">轮回之牢<span id="projectnumber">&#160;0.0.1</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.9.2 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'搜索','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','搜索');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_80876d1476b72d92a9650b7ee3516e4c.html">TeamCurriculumDesign</a></li><li class="navelem"><a class="el" href="dir_7b149e5ebf6d24756f03bb71c9a9b2ab.html">Item</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle"><div class="title">BaseItem.h</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span><span class="comment">//</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno">    2</span><span class="comment">// Created by lenovo on 2021/9/6.</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno">    3</span><span class="comment">//</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno">    4</span> </div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno">    5</span><span class="preprocessor">#ifndef TEAMCURRICULUMDESIGN_BASEITEM_H</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno">    6</span><span class="preprocessor">#define TEAMCURRICULUMDESIGN_BASEITEM_H</span></div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno">    7</span> </div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno">    8</span> </div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno">    9</span><span class="preprocessor">#include &lt;QString&gt;</span></div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"><a class="line" href="class_base_item.html">   13</a></span><span class="keyword">class </span><a class="code hl_class" href="class_base_item.html">BaseItem</a> {</div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno">   14</span><span class="keyword">protected</span>:</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"><a class="line" href="class_base_item.html#a95be0d3fe58b46b495c8d8cd9832cf66">   18</a></span>    QString <a class="code hl_variable" href="class_base_item.html#a95be0d3fe58b46b495c8d8cd9832cf66">img_path</a>;</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno">   19</span><span class="keyword">public</span>:</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"><a class="line" href="class_base_item.html#a3d966b5252386cad87a1aba61cd3c65c">   23</a></span>    <span class="keywordtype">int</span> <a class="code hl_variable" href="class_base_item.html#a3d966b5252386cad87a1aba61cd3c65c">drop_probability</a>;</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno">   24</span><span class="keyword">public</span>:</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno">   29</span>    <span class="keywordtype">int</span> <a class="code hl_function" href="class_base_item.html#a55e1e3ef6da56e19cf614bc017912ac0">getDropProbability</a>() <span class="keyword">const</span>;</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno">   30</span> </div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno">   31</span><span class="keyword">protected</span>:</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"><a class="line" href="class_base_item.html#a1555359d7cdfdaba548208da98a6f06f">   35</a></span>    <span class="keywordtype">int</span> <a class="code hl_variable" href="class_base_item.html#a1555359d7cdfdaba548208da98a6f06f">durability</a>;</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"><a class="line" href="class_base_item.html#ae7cede2e9984e90cba978a02045adcc9">   39</a></span>    <span class="keywordtype">int</span> <a class="code hl_variable" href="class_base_item.html#ae7cede2e9984e90cba978a02045adcc9">max_durability</a>;</div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"><a class="line" href="class_base_item.html#aec06711b8f4551614a43facd072a3e6e">   43</a></span>    <span class="keywordtype">bool</span> <a class="code hl_variable" href="class_base_item.html#aec06711b8f4551614a43facd072a3e6e">unbreakable</a> = <span class="keyword">false</span>;</div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno">   44</span><span class="keyword">public</span>:</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno">   49</span>    <span class="keyword">virtual</span> <span class="keyword">const</span> QString &amp;<a class="code hl_function" href="class_base_item.html#af33b79b244475fc25c2a4dade622b2d5">getImgPath</a>() <span class="keyword">const</span>;</div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno">   50</span> </div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"><a class="line" href="class_base_item.html#a354a59be320769cdcec902e6c11ad4bc">   55</a></span>    <span class="keyword">virtual</span> QString <a class="code hl_function" href="class_base_item.html#a354a59be320769cdcec902e6c11ad4bc">getClassName</a>() <span class="keyword">const</span> = 0;</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno">   56</span> </div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno">   57</span>    <span class="keyword">virtual</span> <a class="code hl_class" href="class_base_item.html">~BaseItem</a>();</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno">   58</span> </div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno">   63</span>    <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="class_base_item.html#a90c0d86f19fd5f9a7bdbd7ce48ee6e75">use</a>();</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno">   64</span> </div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno">   69</span>    <span class="keywordtype">bool</span> <a class="code hl_function" href="class_base_item.html#a2cf660a7184a8e0c905b41e1648bb5b9">isUnbreakable</a>() <span class="keyword">const</span>;</div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno">   74</span>    <span class="keywordtype">int</span> <a class="code hl_function" href="class_base_item.html#ab2bdbbfbd53ce17757c91a8400a23a89">getDurability</a>() <span class="keyword">const</span>;</div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno">   75</span> </div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno">   80</span>    <span class="keywordtype">int</span> <a class="code hl_function" href="class_base_item.html#a1017a64916848f8b7b3671590a610964">getMaxDurability</a>() <span class="keyword">const</span>;</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno">   81</span>};</div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno">   82</span> </div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno">   83</span> </div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno">   84</span><span class="preprocessor">#endif </span><span class="comment">//TEAMCURRICULUMDESIGN_BASEITEM_H</span></div>
<div class="ttc" id="aclass_base_item_html"><div class="ttname"><a href="class_base_item.html">BaseItem</a></div><div class="ttdoc">物品基类</div><div class="ttdef"><b>Definition:</b> BaseItem.h:13</div></div>
<div class="ttc" id="aclass_base_item_html_a1017a64916848f8b7b3671590a610964"><div class="ttname"><a href="class_base_item.html#a1017a64916848f8b7b3671590a610964">BaseItem::getMaxDurability</a></div><div class="ttdeci">int getMaxDurability() const</div><div class="ttdoc">获取物品最大耐久</div><div class="ttdef"><b>Definition:</b> BaseItem.cpp:19</div></div>
<div class="ttc" id="aclass_base_item_html_a1555359d7cdfdaba548208da98a6f06f"><div class="ttname"><a href="class_base_item.html#a1555359d7cdfdaba548208da98a6f06f">BaseItem::durability</a></div><div class="ttdeci">int durability</div><div class="ttdoc">耐久度，不可破坏的物品可能为任意负值</div><div class="ttdef"><b>Definition:</b> BaseItem.h:35</div></div>
<div class="ttc" id="aclass_base_item_html_a2cf660a7184a8e0c905b41e1648bb5b9"><div class="ttname"><a href="class_base_item.html#a2cf660a7184a8e0c905b41e1648bb5b9">BaseItem::isUnbreakable</a></div><div class="ttdeci">bool isUnbreakable() const</div><div class="ttdoc">获取是否不可破坏</div><div class="ttdef"><b>Definition:</b> BaseItem.cpp:11</div></div>
<div class="ttc" id="aclass_base_item_html_a354a59be320769cdcec902e6c11ad4bc"><div class="ttname"><a href="class_base_item.html#a354a59be320769cdcec902e6c11ad4bc">BaseItem::getClassName</a></div><div class="ttdeci">virtual QString getClassName() const =0</div><div class="ttdoc">类名</div></div>
<div class="ttc" id="aclass_base_item_html_a3d966b5252386cad87a1aba61cd3c65c"><div class="ttname"><a href="class_base_item.html#a3d966b5252386cad87a1aba61cd3c65c">BaseItem::drop_probability</a></div><div class="ttdeci">int drop_probability</div><div class="ttdoc">掉落概率，单位：百分之掉落概率</div><div class="ttdef"><b>Definition:</b> BaseItem.h:23</div></div>
<div class="ttc" id="aclass_base_item_html_a55e1e3ef6da56e19cf614bc017912ac0"><div class="ttname"><a href="class_base_item.html#a55e1e3ef6da56e19cf614bc017912ac0">BaseItem::getDropProbability</a></div><div class="ttdeci">int getDropProbability() const</div><div class="ttdoc">获取掉落概率</div><div class="ttdef"><b>Definition:</b> BaseItem.cpp:31</div></div>
<div class="ttc" id="aclass_base_item_html_a90c0d86f19fd5f9a7bdbd7ce48ee6e75"><div class="ttname"><a href="class_base_item.html#a90c0d86f19fd5f9a7bdbd7ce48ee6e75">BaseItem::use</a></div><div class="ttdeci">virtual bool use()</div><div class="ttdoc">返回物品是否损坏</div><div class="ttdef"><b>Definition:</b> BaseItem.cpp:23</div></div>
<div class="ttc" id="aclass_base_item_html_a95be0d3fe58b46b495c8d8cd9832cf66"><div class="ttname"><a href="class_base_item.html#a95be0d3fe58b46b495c8d8cd9832cf66">BaseItem::img_path</a></div><div class="ttdeci">QString img_path</div><div class="ttdoc">前端使用，图片路径</div><div class="ttdef"><b>Definition:</b> BaseItem.h:18</div></div>
<div class="ttc" id="aclass_base_item_html_ab2bdbbfbd53ce17757c91a8400a23a89"><div class="ttname"><a href="class_base_item.html#ab2bdbbfbd53ce17757c91a8400a23a89">BaseItem::getDurability</a></div><div class="ttdeci">int getDurability() const</div><div class="ttdoc">获取物品当前耐久</div><div class="ttdef"><b>Definition:</b> BaseItem.cpp:15</div></div>
<div class="ttc" id="aclass_base_item_html_ae7cede2e9984e90cba978a02045adcc9"><div class="ttname"><a href="class_base_item.html#ae7cede2e9984e90cba978a02045adcc9">BaseItem::max_durability</a></div><div class="ttdeci">int max_durability</div><div class="ttdoc">最大耐久度，不可破坏的物品可能为任意负值</div><div class="ttdef"><b>Definition:</b> BaseItem.h:39</div></div>
<div class="ttc" id="aclass_base_item_html_aec06711b8f4551614a43facd072a3e6e"><div class="ttname"><a href="class_base_item.html#aec06711b8f4551614a43facd072a3e6e">BaseItem::unbreakable</a></div><div class="ttdeci">bool unbreakable</div><div class="ttdoc">是否可以破坏</div><div class="ttdef"><b>Definition:</b> BaseItem.h:43</div></div>
<div class="ttc" id="aclass_base_item_html_af33b79b244475fc25c2a4dade622b2d5"><div class="ttname"><a href="class_base_item.html#af33b79b244475fc25c2a4dade622b2d5">BaseItem::getImgPath</a></div><div class="ttdeci">virtual const QString &amp; getImgPath() const</div><div class="ttdoc">提供给前端的图片路径</div><div class="ttdef"><b>Definition:</b> BaseItem.cpp:7</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.2
</small></address>
</body>
</html>
